<template>
    <el-dialog
      title="提示"
      :visible="previewDialogVisible"
      width="50%"
      @close="handleClose">
      <h2>{{rows.title}}</h2>
      <div><span>{{rows.createTime | date}}</span><span>{{$store.getters.name}}<i class="el-icon-view"></i>{{rows.visits}}</span></div>
      <div class="content" v-html="rows.articleBody">
      </div>
      <!-- <span slot="footer" class="dialog-footer">
        <el-button @click="$emit('update:previewDialogVisible',false)">取 消</el-button>
        <el-button type="primary" @click="$emit('update:previewDialogVisible',false)">确 定</el-button>
      </span> -->
    </el-dialog>
</template>

<script>
import dayjs from 'dayjs'
export default {
  data () {
    return {}
  },
  props: {
    previewDialogVisible: {
      type: Boolean,
      required: true
    },
    rows: {
      type: Object
    }
  },
  methods: {
    handleClose () {
      this.$emit('update:previewDialogVisible', false)
    }
  },
  filters: {
    date (val) {
      return dayjs(dayjs(val).$d).format('YYYY-MM-DD HH:mm:ss')
    }
  }
}
</script>
<style scoped>
.content {
  background: #f5f5f5;
  padding: 10px;
}
</style>
